import request from "@/utils/request";

export function getTaskInfo(params) {
  return request({
    url: "/task/list",
    method: "get",
    params
  });
}

export function updateTask(data) {
  return request({
    url: '/taskUpdate',
    method: 'post',
    data
  })
}

export function deleteTask(data) {
  return request({
    url: '/taskDelete',
    method: 'post',
    data
  })
}

export function startTask(taskId) {
  return request({
    url: "/manage_task/start_task",
    method: "get",
    params: {
      taskId: taskId
    }
  });
}

export function callSyncTask(taskIds, syncType, remoteAddress) {
  return request({
    url: "/task/sync/trigger?taskIds=" + taskIds + "&syncType=" + syncType + "&remoteAddress=" + remoteAddress,
    method: "post",
  });
}